package com.chuangshu.chuangshuteam.controller;


import com.chuangshu.chuangshuteam.dto.Result;
import com.chuangshu.chuangshuteam.entity.Tags;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author k
 * @since 2025-09-21
 */
@RestController
@RequestMapping("/tags")
public class TagsController {

    /**
     * 获取所有默认标签
     * @return 包含学习类和餐饮类默认标签的Map
     */
    @GetMapping("/default")
    public Result getDefaultTags() {
        Map<String, Object> result = new HashMap<>();
        result.put("learning", Tags.DEFAULT_TAGS_LEARNING);
        result.put("eating", Tags.DEFAULT_TAGS_EATING);
        result.put("common", Tags.DEFAULT_TAGS_Common);
        return Result.ok(result);
    }

    /**
     * 获取学习类默认标签
     * @return 学习类默认标签列表
     */
    @GetMapping("/default/learning")
    public Result getDefaultLearningTags() {
        Map<String, Object> result = new HashMap<>();
        result.put("tags", Tags.DEFAULT_TAGS_LEARNING);
        return Result.ok(result);
    }

    /**
     * 获取餐饮类默认标签
     * @return 餐饮类默认标签列表
     */
    @GetMapping("/default/eating")
    public Result getDefaultEatingTags() {
        Map<String, Object> result = new HashMap<>();
        result.put("tags", Tags.DEFAULT_TAGS_EATING);
        return Result.ok(result);
    }
    @GetMapping("/default/common")
    public Result getDefaultCommonTags() {
        Map<String, Object> result = new HashMap<>();
        result.put("tags", Tags.DEFAULT_TAGS_Common);
        return Result.ok(result);
    }
}

